Scripting > CygNet Scripting Guide > Debugging and Error Handling > Custom Log Files

Custom Log Files

The FileSystemObject object is provided with Microsoft’s Scripting Runtime Library and allows access to drive, folder, and file information. This permits direct creation of log files and the ability to append information to them for debugging purposes. Documentation on the File System Object is included on the MSDN website.

Adding a Line of Text to Log Files

Example

Dim fso

Set fso = CreateObject("Scripting.FileSystemObject")

Set textFile = fso.OpenTextFile("C:\CygNet\Logs\Test.txt", 2, True)

textFile.WriteLine("Log file text.")

textFile.Close


Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.